FROM php:7.3-apache

#默认时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#解决错误error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf

#配置apt镜像
#RUN sed -i 's/deb.debian.org/192.168.36.36/g' /etc/apt/sources.list && sed -i 's/security.debian.org/192.168.36.36/g' /etc/apt/sources.list 

RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list

RUN apt-get update && apt-get install -y libmemcached-dev zlib1g-dev gnupg2 \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev \
&& pecl install redis sqlsrv pdo_sqlsrv \
&& docker-php-ext-enable redis pdo_sqlsrv sqlsrv \
&& docker-php-ext-install mysqli pdo_mysql

#设置默认PHP环境
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

RUN a2enmod rewrite.load
ENV LC_ALL C.UTF-8